<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">

    <h3>
        <#if links>修改友情链接<#else>添加友情链接</#if>
    </h3>
 
</div>
<div class="pad10A">
<#if links> 
<form id="demo-form1" action="/popularizes/linksupdate/${links.id}" class="col-md-12" method="POST">
<#else>
<form id="demo-form1" action="/popularizes/linksadd" class="col-md-12" method="POST">
</#if>

	<#if links>
	<input type="hidden" name="id" value="${links.id}"/>
	</#if>
   <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                名称:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-8">
            <input type="text" id="name" name="name" data-trigger="change" data-required="true" class="parsley-validated" value="${links.name}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                URL地址:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-8">
            <input type="text" id="url" name="url" data-trigger="change" data-required="true" class="parsley-validated" value="${links.url}">
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                描述:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-8">
            <textarea id="display" name="display" data-trigger="change" data-required="true" class="parsley-validated" value="">${links.display}</textarea>
        </div>
    </div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                备注:
            </label>
        </div>
        <div class="form-input col-md-8">
            <textarea id="memo" name="memo" data-trigger="change" class="parsley-validated" value="">${links.memo}</textarea>
        </div>
    </div>
    <div class="divider"></div>
    <div class="form-row">
        <input type="hidden" name="superhidden" id="superhidden">
       <div class="form-input col-md-10 col-md-offset-2">
                    <a href="javascript:;" class="btn medium primary-bg radius-all-4 col-md-2" id="demo-form-2-valid">
                        
                                                                         提交
                        
                 </a>
        </div>
    </div>   

</form>
</div>
</div>



<script type="text/javascript">
$(function(){
		$("#demo-form-2-valid").click(function(){
			$('#demo-form1').parsley('validate');
	    	$('#demo-form1').trigger('submit');
		});
	});

</script>